// import Mock from "mockjs";
export default {
  getMenu: (config) => {
    const {
      username,
      password
    } = JSON.parse(config.body);
    // 先判断用户是否存在
    // 判断账号和密码是否对应
    if (username === "admin" && password === "admin") {
      return {
        code: 20000,
        data: {
          menu: [{
              path: "/home",
              name: "home",
              label: "首页",
              icon: "home",
              url: "home/index",
            },
            {
              label: "会员管理",
              icon: "user",
              children: [{
                  path: "/reader",
                  name: "reader",
                  label: "用户管理",
                  url: "user/reader.vue",
                },
                {
                  path: "/manager",
                  name: "manager",
                  label: "商家管理",
                  url: "user/manager.vue",
                },
              ],
            },
            {
              label: "会员商城",
              icon: "user",
              children: [{
                  path: "/books",
                  name: "reader",
                  label: "门店管理",
                  url: "book/books.vue",
                },
                {
                  path: "/test",
                  name: "test",
                  label: "商品管理",
                  url: "book/test.vue",
                },
              ],
            }
          ],
          // token: Mock.Random.guid(),
          message: "获取成功",
        },
      };
    } else {
      return {
        code: -999,
        data: {
          message: "密码错误",
        },
      };
    }
  },
};